package jgl.vajra.driver.manager;

import android.os.Bundle;

import jgl.vajra.driver.listener.MessageDlialogListener;
import jgl.vajra.driver.part.home.fragment.GrabOrderFragment;
import jgl.vajra.driver.part.home.fragment.HomePageFragment;
import jgl.vajra.driver.part.home.fragment.HomeVehicleTypeFragment;
import jgl.vajra.driver.part.home.fragment.MinePageFragment;
import jgl.vajra.driver.part.home.fragment.OrderPageFragment;
import jgl.vajra.driver.part.home.fragment.OrderPageListFragment;
import jgl.vajra.driver.part.home.fragment.TaskPageFragment;
import jgl.vajra.driver.widget.dialogfragment.MessageDialogFragment;

public class FragmentManager {

    public static MessageDialogFragment getMessageDialogFragment(String messageContent, boolean isLeftCloseDialog, boolean isRightCloseDialog, String leftText, String rightText, MessageDlialogListener listener) {
        MessageDialogFragment fragment = new MessageDialogFragment();
        fragment.setMessageConent(messageContent);
        fragment.setLeftCloseDialog(isLeftCloseDialog);
        fragment.setRightCloseDialog(isRightCloseDialog);
        fragment.setRightText(rightText);
        fragment.setLeftText(leftText);
        fragment.setMessageDialogListener(listener);
        return fragment;
    }

    public static MessageDialogFragment getMessageDialogFragment(String messageContent, MessageDlialogListener listener) {
        return getMessageDialogFragment(messageContent, true, true, "取消", "确认", listener);
    }

    public static MessageDialogFragment getMessageDialogFragment(String messageContent, String leftText, String rightText, MessageDlialogListener listener) {
        return getMessageDialogFragment(messageContent, true, true, leftText, rightText, listener);
    }

    public static MessageDialogFragment getMessageDialogAdditional(MessageDlialogListener listener) {
        return getMessageDialogFragment("是否需要增加司索工？", "不需要", "增加", listener);
    }

    public static MessageDialogFragment getMessageDialogCancelAccount(MessageDlialogListener listener) {
        return getMessageDialogFragment("注销后您的身份、账户信息、钱包余额、优惠券及单子信息都会被清空且无法找回", "我再想想", "确定注销", listener);
    }

    public static GrabOrderFragment getGrabOrderFragment() {
        GrabOrderFragment pageFragment = new GrabOrderFragment();
        return pageFragment;
    }

    public static HomePageFragment getHomePageFragment() {
        HomePageFragment pageFragment = new HomePageFragment();
        return pageFragment;
    }

    public static TaskPageFragment getTaskPageFragment() {
        TaskPageFragment pageFragment = new TaskPageFragment();
        return pageFragment;
    }

    public static OrderPageFragment getOrderPageFragment() {
        OrderPageFragment pageFragment = new OrderPageFragment();
        return pageFragment;
    }

    public static OrderPageListFragment getOrderPageListFragment(int type) {
        OrderPageListFragment pageFragment = new OrderPageListFragment();
        Bundle bundle = new Bundle();
        bundle.putInt("type", type);
        pageFragment.setArguments(bundle);
        return pageFragment;
    }

    public static MinePageFragment getMinePageFragment() {
        MinePageFragment pageFragment = new MinePageFragment();
        return pageFragment;
    }

    public static HomeVehicleTypeFragment getHomeVehicleTypeFragment(int type, String name, String title, boolean isCalculator) {
        HomeVehicleTypeFragment pageFragment = new HomeVehicleTypeFragment();
        Bundle bundle = new Bundle();
        bundle.putInt("type", type);
        bundle.putString("name", name);
        bundle.putString("title", title);
        bundle.putBoolean("isCalculator", isCalculator);
        pageFragment.setArguments(bundle);
        return pageFragment;
    }
}
